import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    // 线上
    token: localStorage.getItem('x-auth-token') ? localStorage.getItem('x-auth-token') : '',
    // 本地 本地测试写死token 是因为本地测试的站点不一样 localStorage只在同一站点获取
    // token: '5118d6b3c46e0f93de62aafed9a7e0da'
  },
  mutations: {
    DEL_TOKEN: function (state) {
      state.token = '';
      localStorage.removeItem("x-auth-token");
    }
  },
  actions: {
  },
  modules: {
  }
})
